package MapBase.logic.control.MapBaseControl.Mouse
{
	/**
	 *游戏地图点击事件 
	 */	
	import MapBase.logic.MapBase;
	
	import fl.containers.UILoader;
	
	import flash.display.Loader;
	import flash.net.URLRequest;

	public class MapBaseMouseHand
	{
		/**
		 * 
		 * @param mapBase
		 * @param mouseHandBox			鼠标盒子
		 * @param imgEntityMode			鼠标点击当前图片的数据
		 * @param selectEntityLayer		是否选中实体层
		 * @param delEntity				删除实体
		 * @param dragEntity			拖动实体
		 * 
		 */		
		public function MapBaseMouseHand()
		{
		
		}
		
		static public function MDownCMD(mapBase:MapBase,mouseHandBox:Loader,imgEntityMode:Object,selectEntityLayer:Boolean,delEntity:Boolean,dragEntity:Boolean):void
		{
			if(!selectEntityLayer)  return;
			
			if(delEntity)		    return;
			
			if(dragEntity)			return;
			
			mapBase.setSelectTile();
			
			if(mouseHandBox.content)
			{
				if(imgEntityMode)
				{
					var uil: UILoader = new UILoader;
					uil.height = mouseHandBox.height;
					uil.width = mouseHandBox.width;
					
					uil.load(new URLRequest(imgEntityMode["url"]));
					mapBase.addEntityToWorld(uil,imgEntityMode["id"]);
				}
			}
		}
	}
}